import axios from "axios";

const service = axios.create({
  baseURL: process.env.VUE_APP_PROJECT_API,
  timeout: 10000,
})

service.interceptors.request.use(
    config => {
      return config
    },
    () => {
      return []
    }
)

service.interceptors.response.use(
    response => {
      const res = response.data
      if (res.constructor == Array) {
        return res
      } else {
        return [];
      }
    },
    () => {
      return []
    }
)

export default service
